import { get, post } from '../http'

// 获取订单列表
export const tagList = () => {
  return get('/oms/orderTag/listByParam')
}

// 新增标签
export const saveOrUpdateBatch = (payload: any) => {
  return post('/oms/orderTag/saveOrUpdateBatch', payload)
}

// 删除标签
export const delByIds = (payload: any) => {
  return post('/oms/orderTag/delByIds', payload)
}

// 分页查询fba订单 /oms/orderIndex/page
export const fbaOrder = (payload: any) => {
  return get('/oms/orderIndex/page', payload)
}

// fba订单批量添加标签 /oms/orderIndex/addTagBatch
export const addTagBatch = (payload: any) => {
  return post('/oms/orderIndex/addTagBatch', payload)
}

// fba订单批量删除标签 /oms/orderIndex/cancelTagBatch
export const cancelTagBatch = (payload: any) => {
  return post('/oms/orderIndex/cancelTagBatch', payload)
}

// 更新sku及销售员 /oms/orderIndex/syncProductRelated
export const matchingProduct = (payload: any) => {
  return post('/oms/orderIndex/syncProductRelated', payload)
}
// 同步订单 /oms/orderIndex/syncOrders
export const syncOrders = (payload: any) => {
  return post('/oms/orderIndex/syncOrders', payload)
}

// 退货记录  /oms/fbaOrderReturn/page
export const fbaOrderReturn = (payload: any) => {
  return get('/oms/fbaOrderReturn/page', payload)
}

// 换货记录  /oms/fbaOrderReplace/page
export const fbaOrderReplace = (payload: any) => {
  return get('/oms/fbaOrderReplace/page', payload)
}

// 统计订单状态数量 /oms/orderIndex/countOrderStatus
export const countOrderStatus = (payload?: any) => {
  return post('/oms/orderIndex/countOrderStatus', payload)
}

// 查询fba订单详情 /oms/orderIndex/getRelatedById
export const getRelatedById = (payload: any) => {
  return get('/oms/orderIndex/getRelatedById', payload)
}

// 查询店铺站点 /user/v1/shop/findShopMarketByParam
export const findShopMarketByParam = (payload?: any) => {
  return get('/user/v1/shop/findShopMarketByParam', payload)
}

// 查询亚马逊订单财务数据报告 /oms/amzOrderFinancial/listVOByParam
export const listVOByParam = (payload?: any) => {
  return get('/oms/amzOrderFinancial/listVOByParam', payload)
}

// 同步订单数据 /oms/amzOrderFinancial/syncAmzOrderFinancials
export const syncAmzOrderFinancials = (payload?: any) => {
  return post('/oms/amzOrderFinancial/syncAmzOrderFinancials', payload)
}

// FBM订单列表
export const fbmPage = (payload?: any) => {
  return get('/oms/order/page', payload)
}

// 更新sku及销售人员
export const syncProductRelated = (payload?: any) => {
  return post('/oms/orderUpdate/syncProductRelated', payload)
}

// 批量添加标签 /oms/orderUpdate/addTagBatch
export const addFBMorderTagBatch = (payload?: any) => {
  return post('/oms/orderUpdate/addTagBatch', payload)
}
// 批量取消标签
export const cancelFBMorderTagBatch = (payload: any) => {
  return post('/oms/orderUpdate/cancelTagBatch', payload)
}

// 批量取消订单 /oms/orderUpdate/cancelOrders
export const cancelOrders = (payload: any) => {
  return post('/oms/orderUpdate/cancelOrders', payload)
}

// 批量提交发货仓 /oms/orderUpdate/submitWarehouse
export const submitWarehouse = (payload: any) => {
  return post('/oms/orderUpdate/submitWarehouse', payload)
}

// 包裹提交发货仓 /oms/orderUpdate/submitPackageWarehouse
export const submitPackageWarehouse = (payload: any) => {
  return post('/oms/orderUpdate/submitPackageWarehouse', payload)
}

// 一键同步订单 /oms/orderUpdate/syncOrders
export const syncFBAOrders = (payload: any) => {
  return post('/oms/orderUpdate/syncOrders', payload)
}

// 批量更新包裹发货仓 /oms/orderUpdate/updatePackageWarehouse
export const updatePackageWarehouse = (payload: any) => {
  return post('/oms/orderUpdate/updatePackageWarehouse', payload)
}

// 批量更新订单包裹发货仓 /oms/orderUpdate/updateOrderPackageWarehouse
export const updateOrderPackageWarehouse = (payload: any) => {
  return post('/oms/orderUpdate/updateOrderPackageWarehouse', payload)
}
// 批量更新订单备注

export const updateItemRemark = (payload: any) => {
  return post('/oms/orderUpdate/updateItemRemark', payload)
}

// 拆分订单 /oms/tobeCombineOrder/splitOrder
export const splitOrder = (payload: any) => {
  return post('/oms/tobeCombineOrder/splitOrder', payload)
}

// 更改或新增商品报关信息

export const saveOrUpdateItemDeclaration = (payload: any) => {
  return post('/oms/orderUpdate/saveOrUpdateItemDeclaration', payload)
}

// 物流下单
export const createOrderShip = (payload: any) => {
  return post('/oms/orderUpdate/createOrderShip', payload)
}

// 物流下单自定义物流商 /oms/orderUpdate/updatePackageShip
export const updatePackageShip = (payload: any) => {
  return post('/oms/orderUpdate/updatePackageShip', payload)
}

// 查询待合并订单 /oms/tobeCombineOrder/splitOrder
export const tobeCombineOrderPage = (payload: any) => {
  return get('/oms/tobeCombineOrder/page', payload)
}

// 合并订单 /oms/tobeCombineOrder/combineOrder
export const combineOrder = (payload: any) => {
  return post('/oms/tobeCombineOrder/combineOrder', payload)
}

// 取消合并订单   /oms/tobeCombineOrder/cancelTobeCombine
export const cancelTobeCombine = (payload: any) => {
  return post('/oms/tobeCombineOrder/cancelTobeCombine', payload)
}

// 禁止处理 /oms/orderUpdate/stopHandOrder
export const stopHandOrder = (payload: any) => {
  return post('/oms/orderUpdate/stopHandOrder', payload)
}

// 取消订单 /oms/orderUpdate/cancelOrder
export const cancelOrder = (payload: any) => {
  return post('/oms/orderUpdate/cancelOrder', payload)
}

// 查询订单详情 /oms/order/getById
export const getOrderDetail = (payload: any) => {
  return get('/oms/order/getById', payload)
}

// 更新订单商品sku /oms/orderUpdate/updateItemSku
export const updateItemSku = (payload: any) => {
  return post('/oms/orderUpdate/updateItemSku', payload)
}

// 更新订单备注 /oms/orderUpdate/saveOrUpdateOrderRemark
export const saveOrUpdateOrderRemark = (payload: any) => {
  return post('/oms/orderUpdate/saveOrUpdateOrderRemark', payload)
}

// 修改订单地址 /oms/orderUpdate/updateOrderAddress
export const updateOrderAddress = (payload: any) => {
  return post('/oms/orderUpdate/updateOrderAddress', payload)
}

// 更新订单地址锁定状态 /oms/orderUpdate/updateOrderAddressLock
export const updateOrderAddressLock = (payload: any) => {
  return post('/oms/orderUpdate/updateOrderAddressLock', payload)
}

// 更新订单商品定制信息 /oms/orderUpdate/updateItemCustom
export const updateItemCustom = (payload: any) => {
  return post('/oms/orderUpdate/updateItemCustom', payload)
}
// 统计订单状态数量 /oms/order/countOrderStatus
export const countOrderStatusNum = (payload?: any) => {
  return post('/oms/order/countOrderStatus', payload)
}
// 统计订单标签数量 /oms/order/countOrderTag
export const countOrderTagNum = (payload?: any) => {
  return post('/oms/order/countOrderTag', payload)
}

// 解除仅禁止处理 /oms/orderUpdate/relieveStopHandOrder
export const relieveStopHandOrder = (payload?: any) => {
  return post('/oms/orderUpdate/relieveStopHandOrder', payload)
}

// 批量查询仓库库存 /inventory/v1/inventory/findInventoryBatch
export const findInventoryBatch = (payload?: any) => {
  return post('/inventory/v1/inventory/findInventoryBatch', payload)
}

// 分页查询订单包裹 /oms/orderPackage/page
export const getOrderPackageList = (payload?: any) => {
  return get('/oms/orderPackage/page', payload)
}

// 统计订单包裹数量 /oms/orderPackage/countStatus
export const getOrderPackageStatusNum = (payload?: any) => {
  return get('/oms/orderPackage/countStatus', payload)
}

// 查询订单包裹列表 /oms/orderPackage/listPackage
export const listPackage = (payload?: any) => {
  return get('/oms/orderPackage/listPackage', payload)
}

// 确认出库 /oms/orderPackage/completeOutboud
export const completeOutboud = (payload?: any) => {
  return post('/oms/orderPackage/completeOutboud', payload)
}
// 提交拣货 /oms/orderPackage/submitPicking
export const submitPicking = (payload?: any) => {
  return post('/oms/orderPackage/submitPicking', payload)
}
// 打印物流面单 /oms/orderPackage/printExpressLabel
export const printExpressLabel = (payload?: any) => {
  return post('/oms/orderPackage/printExpressLabel', payload)
}
// 撤回待审核 /oms/orderPackage/rollbackTocheck
export const rollbackTocheck = (payload?: any) => {
  return post('/oms/orderPackage/rollbackTocheck', payload)
}
// 撤回待处理 /oms/orderPackage/rollbackTohand
export const rollbackTohand = (payload?: any) => {
  return post('/oms/orderPackage/rollbackTohand', payload)
}
// 批量更新拣货员
export const updatePickers = (payload?: any) => {
  return post('/oms/orderPackage/updatePickers', payload)
}
// 完成拣货
export const completePicking = (payload?: any) => {
  return post('/oms/orderPackage/completePicking', payload)
}

//查询订单包裹详情
export const getPackageById = (payload?: any) => {
  return get('/oms/orderPackage/getPackageById', payload)
}

// 打印出库单
export const printOutboundbill = (payload?: any) => {
  return post('/oms/orderPackage/printOutboundbill', payload)
}
// 预览多渠道订单
export const getFulfillmentPreview = (payload?: any) => {
  return post('/oms/multiChannelOrder/getFulfillmentPreview', payload)
}
// 创建多渠道订单
export const createFulfillmentOrder = (payload?: any) => {
  return post('/oms/multiChannelOrder/createFulfillmentOrder', payload)
}
// 取消多渠道配送
export const cancelFulfillmentOrder = (payload?: any) => {
  return post('/oms/multiChannelOrder/cancelFulfillmentOrder', payload)
}
// 同步多渠道配送
export const syncMultiChannelOrder = (payload?: any) => {
  return post(`/oms/multiChannelOrder/syncMultiChannelOrder?packageId=${payload}`)
}

// 查询亚马逊多渠道订单
export const getFbaMultiChannelOrder = (payload?: any) => {
  return post('/oms/multiChannelOrder/getFbaMultiChannelOrder', payload)
}

// 绑定fba多渠道订单
export const bindFbaMultiChannelOrder = (payload?: any) => {
  return post('/oms/multiChannelOrder/bindFbaMultiChannelOrder', payload)
}

// 新增自发货订单
export const saveOrUpdateOrderRelated = (payload?: any) => {
  return post('/oms/orderUpdate/saveOrUpdateOrderRelated', payload)
}
// 删除自发货订单
export const delOrders = (payload?: any) => {
  return post('/oms/orderUpdate/delOrders', payload)
}

// 批量设置包装
export const updateItemPack = (payload?: any) => {
  return post('oms/orderUpdate/updateItemPack', payload)
}
// 查询亚马逊库存
export const getInventorySummaries = (payload: any) => {
  return get('/amzfeed/amazon/sp/getInventorySummaries', payload)
}
